function init_page_xtable(obj, loadSuccess) {
	function serializeObject(obj, aoData) {
		if (obj == null || obj == undefined) {
			return
		}
		var a = obj.serializeArray();
		$.each(a, function() {
			aoData[this.name] = this.value || ""
		});
		return aoData
	}
	var datatableInit = function(me) {
		var dataTableId = $(me).attr("id");
		var aoColumns = [];
		var oTable;
		function retrieveData(page) {
			var sSource = $("#" + dataTableId).data("action");
			var aoData = {};
			var params = $("#" + dataTableId).data("params");
			if ($.isNotEmpty(params)) {
				for ( var name in params) {
					aoData[name] = params[name]
				}
			}
			aoData = serializeObject($("#" + dataTableId + "_form"), aoData);
			$.ajax({
				"dataType" : "json",
				"type" : "POST",
				"url" : sSource,
				"data" : aoData,
				"beforeSend" : function() {
					jQuery(".loading").removeClass("ui-hidden")
				},
				"complete" : function(XMLHttpRequest, textStatus) {
					jQuery(".loading").addClass("ui-hidden")
				},
				"success" : function(json) {
					if (json == null || json == "" || json == undefined
							|| json.code > 0) {
						if (json == undefined) {
							$.confirm({cancelButton: "关   闭",title: '提示',text:"操作错误!"});
						} else {
							if (json.code == 10000) {
								$.confirm({cancelButton: "关   闭",title: '提示',text:"您没有资源操作权限!"});
							} else {
								$.confirm({cancelButton: "关   闭",title: '提示',text:json.message || ""});
								if (json.data != undefined) {
									fnCallback(json.data, dataTableId)
								}
							}
						}
					} else {
						if (json.data != undefined) {
							fnCallback(json.data, dataTableId)
						}
					}
				},
				"error" : function(xhr, textStatus, errorThrown) {
					$.confirm({cancelButton: "关   闭",title: '提示',text:"操作错误,请刷新页面!"});
				}
			})
		}
		var fnCallback = function(data, tableId) {
			var html = [];
			for (var i = 0; i < data.length; i++) {
				var row = data[i];
				html.push("<tr>");
				for (var j = 0; j < aoColumns.length; j++) {
					var col = aoColumns[j];
					var cLable = col["mData"];
					var cData = row[cLable];
					if (typeof col["callback"] === "function") {
						var returnHtml = col["callback"](cData, cLable, row);
						html.push("<td>" + returnHtml + "</td>")
					} else if(col["callback"] != ""){
						var returnHtml = eval(col["callback"])(cData, cLable, row);
						html.push("<td>" + returnHtml + "</td>")
					}else {
						if (cData != undefined && cData != "undefined"
								&& cData != null && cData != "") {
							html.push("<td>" + cData + "</td>")
						} else {
							html.push("<td></td>")
						}
					}
				}
				html.push("</tr>")
			}
			$("#" + tableId + " > tbody").html(html.join(""));
			if (loadSuccess) {
				loadSuccess()
			}
		};
		$("#" + dataTableId).find("thead > tr:eq(0) > th,thead > tr:eq(0) > td").each(function(index, element) {
			var item_o={};
			var $this=$(this);
			item_o["mData"]=$(this).data("title") || "";
			if ($this.data("crud")) {
				item_o["callback"] = function(data, name, row) {
					var th_div_html = $.trim($this.find("div:hidden").html()|| "");
					if (th_div_html == "") {
						return ""
					}
					var html=[];
                    $this.find("button").each(function(index) {
                        if ($(this).data("type") == "change") {
                        	var th_callback = $(this).data("callback");
                            var th_toge = $(this).data("toge");
                            if (th_toge == undefined || th_toge == "") {
                            	if (th_callback != undefined && th_callback != "") {
                            		html.push(eval(th_callback)(data, name, row));
                                } 
                            }else{
                            	if (th_callback != undefined && th_callback != "") {
                                	var list={};
                                	$.each(th_toge.split(","), function() {
                                		list[this]=row[this];
                                	}); 
                                	html.push(eval(th_callback)(data, name, row,list));
                                } 
                            }
                        }else{
                        	html.push($(this).prop('outerHTML'));
                        }
                    });
                    th_div_html=html.join("");
					var title = $this.data("title");
					for ( var key in title) {
						do {
							th_div_html = th_div_html.replace(":" + key, row[title[key]])
						} while (th_div_html.indexOf(key) != -1)
					}
					return th_div_html;
				};
			}else{
				item_o["callback"]=$(this).data("callback") || "";
			}
			aoColumns.push(item_o);
		});
		retrieveData();
		$("#" + dataTableId + "_search").on("click", function() {
			retrieveData()
		});
	};
	if (obj == null || obj == "") {
		$("table[data-datatable=true]").each(function() {
			datatableInit(this)
		})
	} else {
		datatableInit(obj)
	}
};